package com.zengyan.gd.model;

import com.zengyan.gd.enums.Sex;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import lombok.Data;

//
//CREATE TABLE `user` (
//        `user_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '组织id',
//        `student_num` varchar(64) NOT NULL COMMENT '学号',
//        `name` varchar(64) DEFAULT NULL COMMENT '名字',
//        `email` varchar(64) DEFAULT NULL COMMENT '邮箱',
//        `grade` varchar(64) DEFAULT NULL COMMENT '年级',
//        `college` varchar(64) DEFAULT NULL COMMENT '学院',
//        `profession` varchar(64) DEFAULT NULL COMMENT '专业',
//        `sex` tinyint(3) DEFAULT '1' COMMENT '性别',
//        `class` varchar(64) DEFAULT NULL COMMENT '班级',
//        `avatar` varchar(512) DEFAULT NULL COMMENT '头像',
//        `avatar` varchar(512) DEFAULT NULL COMMENT '背景图',
//        `description` varchar(512) DEFAULT NULL COMMENT '描述',
//        `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
//        `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
//        PRIMARY KEY (`user_id`),
//        UNIQUE KEY `uqe_student_num` (`student_num`)
//        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
//

@Entity
@Data
public class User {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private String user_id;

    @Column(name = "student_num")
    private String studentNum;

    private String name;
    private String email;
    private String grade;
    private String college;
    private String profession;
    private Sex sex;

    @Column(name = "class")
    private String clazz; //班级

    @Column(name = "bg")
    private String bgUrl; //班级
    private String description; //描述
    @Column(name = "avatar")
    private String avatarUrl; //班级

    public int getSex() {
        return sex.getSex();
    }
}